import Axios from './index'

let base = 'http://localhost:8000/'

Axios.defaults.withCredentials = true

export function post (url, data) {
    let formdata = new FormData()
    for (let item in data) {
        formdata.append(item, data[item])
    }
    return Axios({
        url: base + url,
        method: 'post',
        data: formdata
    })
}
Axios.defaults.withCredentials = true

const util = {
    post
}

export default util